const mongoose = require('@/db/core')
const {Schema, model} = mongoose
const versionKey = { versionKey: false } // 去掉mongoose自动带 __v 的字段

const ArticleSchema = new Schema({
  article_id: String,
  author: String,
  view: Number,
  location: String,
  image: String,
  title: String,
  content: String
}, versionKey)

const ArticleDetailsSchema = new Schema({
  article_id: String,
  author: String,
  view: Number,
  location: String,
  title: String,
  content: String
})

module.exports = {
  modelArticle: model('article', ArticleSchema),
  modelDetailsArticle: model('book', ArticleDetailsSchema)
}